package com.pw.study.leetcode;

/**
 * @Author: linux_future
 * @since: 2022/4/18
 **/
public class Q70 {

    public static void main(String[] args) {
        int n=15;
        int kk = test(n);
        int bb = climbStairs(n);
        System.out.println(kk+" "+bb);
    }
    public static int climbStairs(int n) {
        int p = 0, q = 0, r = 1;
        for (int i = 1; i <= n; ++i) {
            p = q;
            q = r;
            r = p + q;
        }
        return r;
    }


    private static int test(int n) {
        if(n==1||n==2){
            return n;
        }else {
           return test(n-1)+test(n-2);
        }
    }
}
